package pattern.state.model;

public class SecondGear extends Gear {

	public SecondGear(Car car) {
		this.car = car;
	}
	@Override
	public void accelerate() throws Exception {
		car.setText("Faster? switch to 3 gear..");
		car.setState(car.getThirdGear());
		
	}

	@Override
	public void slowDown() throws Exception {
		car.setText("Slower? switch to 1 gear..");
		car.setState(car.getFirstGear());
		
	}

	@Override
	public void goBack() throws Exception {
		throw new IllegalStateException("Want to break the gearbox !?");
		
	}

	@Override
	public void stop() throws Exception {
		car.setText("Stop --- Neutral");
		car.setState(car.getNeutral());
		
	}

}
